﻿namespace Super
{
	public class SimpleSingle<T> where T : SimpleSingle<T>, new()
	{		
		private static T ins;
		public static T Ins
		{
			get
			{
				if (ins == null)
				{
					ins = new T();
					ins.OnInit();
				}

				return ins;
			}
		}
		
		public static void Initialize()
		{
			if (ins == null)
			{
				ins = new T();
				ins.OnInit();
			}
		}
		
		public virtual void OnInit()
		{
			
		}
	}

}
